public class SequentialSearch {
	public static int counter;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int[] array = ArrayUtil.randomIntArray(100, 100);

		System.out.print(SequentialSearch.search(new int[] { 1, 2, 3, 4 }, 5));
	}

	public static int search(int[] a, int key) {
		for (int i = 0; i < a.length; i++) {
			counter++;
			if (a[i] == key)
				return a[i];
		}
		return -1;
	}

}
